import java.util.*;
/**
 * MessageQueue ment to hold messages to be display in notification area of the display
 * @author kkopiec
 *
 */
public class MessageQueue {
	protected static String[] contents;
	protected static int f;
	protected static int r;
	protected static int size;
	public MessageQueue(int sizeOfQueue){
		contents = new String[sizeOfQueue];
		f = 0;
		r = 0;
		size = sizeOfQueue;
		for (int i = f; i < size; i++){
			enqueue("");
		}
	}
	public void enqueue(String s){
		contents[r] = s;
		r = (r+1) % size;
		f = r;
	}
	public String pick(){
		String tmp = contents[f];
		f = (f+1)% size;
		return tmp;
	}
	public ArrayList<String> notifications(){
		ArrayList<String> nots = new ArrayList<String>();
		for (int i = 0; i< size ; i++){
			nots.add(pick()); 
		}
		return nots;
	}
	
	

}
